package cn.javass.dp.composite.example3;



public class Client {
    public static void main(String[] args) {
        Composite root = new Composite("服装");
        Compoment c1 = new Composite("男装");
        Compoment c2 = new Composite("女装");

        Compoment l1 = new Leaf("寸衫");
        Compoment l2 = new Leaf("夹克");
        Compoment l3 = new Leaf("裙子");
        Compoment l4 = new Leaf("套装");

        root.addChild(c1);
        root.addChild(c2);
        c1.addChild(l1);
        c1.addChild(l2);
        c2.addChild(l3);
        c2.addChild(l4);
        root.removeChild(c1) ;
        root.printStruct("");

    }
}
